package com.cloudream.core.controller;

import com.cloudream.core.dto.InfoDTO;
import com.cloudream.core.service.InfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class IndexController {

    @Resource(name = "infoService")
    InfoService infoService;

    @RequestMapping("/test")
    @ResponseBody
    public Object test() {
        InfoDTO info = new InfoDTO().initialize();
        info.setName("123");
        int rtn = infoService.add(info);
        return rtn;
    }

    @RequestMapping("/get")
    @ResponseBody
    public Object get() {
        return infoService.getAll();
    }
}
